import axios from 'axios';

const http2 = axios.create({
  baseURL: '/api',
  timeout: 30000,
});


http2.interceptors.request.use(config => {
  config.headers['Authorization'] = 'Basic YWRtaW46cHVibGlj';
  return config;
}, function (error) {
  console.log(error);
  return Promise.reject(error);
});

http2.interceptors.response.use(function (response) {

  return response.data;
}, function (error) {
  console.log(error);
  return Promise.reject(error);
});
export default http2;